package java_demos.java_basic.instance_demos.about_string;

import java.util.StringTokenizer;

public class StringTokenizerUse {
    public static void main(String[] args) {
        /**
         * @description: 使用StirngTokenizer进行字符串的分割
         * @author:
         * @date: 2024/5/29 下午3:08
         * @param: [args]
         * @return: void
         **/
        String str = "This is String , split by StringTokenizer, created by runoob";
        StringTokenizer st = new StringTokenizer(str);
        while(st.hasMoreElements()){
            System.out.println(st.nextElement());
        }
        StringTokenizer st2 = new StringTokenizer(str, ",");

        while (st2.hasMoreElements()) {
            System.out.println(st2.nextElement());
        }

    }
}
